package com.example.demo.dto;

import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.example.demo.entity.ProductionOrderMaterial;
import com.example.demo.entity.Unit;
import com.example.demo.entity.ProcurementOrderItem;
import com.example.demo.entity.ProductionOrder;
import com.diboot.iam.entity.IamUser;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 领生产物料 DTO定义
 * @author MyName
 * @version 1.0
 * @date 2024-03-19
 * Copyright © MyCompany
 */
@Getter
@Setter
@Accessors(chain = true)
public class ProductionOrderMaterialDTO extends ProductionOrderMaterial {

    private static final long serialVersionUID = -3096053003909123246L;

    /**
     * 关联字段 采购单项.名称：ProcurementOrderItem.name
     */
    @BindQuery(comparison = Comparison.EQ, entity = ProcurementOrderItem.class, field = "name", condition = "this.procurement_order_item_id=id")
    private String procurementOrderItemName;

    /**
     * 关联字段 生产单.标题：ProductionOrder.title
     */
    @BindQuery(comparison = Comparison.EQ, entity = ProductionOrder.class, field = "title", condition = "this.production_order_id=id")
    private String productionOrderTitle;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindQuery(comparison = Comparison.EQ, entity = IamUser.class, field = "realname", condition = "this.iam_user_id=id")
    private String iamUserRealname;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindQuery(comparison = Comparison.EQ, entity = IamUser.class, field = "realname", condition = "this.create_by=id")
    private String createByName;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindQuery(comparison = Comparison.EQ, entity = IamUser.class, field = "realname", condition = "this.update_by=id")
    private String updateByName;

    /**
     * 关联字段 单位.名称：Unit.name
     */
    @BindQuery(comparison = Comparison.EQ, entity = Unit.class, field = "name", condition = "this.unit_id=id")
    private String unitName;
}
